home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / MacX25 / MacX25 Developer's Kit / MacX25_Interfaces / CIncludes / Initab.h next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  12.2 KB  |  277 lines  |  [TEXT/MPS ]

  1.  
  2.  
  3. /*************************************************************************
  4. **                                                                       *
  5. **  Initab.h is the definition file for the X.25 initialization tables     *
  6. **                                                                       *
  7. **-----------------------------------------------------------------------*
  8. **                                                                       *
  9. **               Copyright Apple Computer, Inc. 1987-88                  *
  10. **                         All Rights Reserved                           *
  11. **                     Apple Computer Confidential                       *
  12. **                                                                       *
  13. **-----------------------------------------------------------------------*
  14. **                                                                       *
  15. **  Comments: The definitions FILL and FILLM define table extension area *
  16. **        that INITAB will depend on, therefore the parameters provided to *
  17. **        INITAB.c must not exceed the table space reserved here.             *
  18. **                                                                         *
  19. **        FILLM = Number of buffer pools defined x 2                         *
  20. **        FILL  = Number of PVCs defined x 8                                 *
  21. **                                                                       * 
  22. **                                                                       *
  23. **                                                                       *
  24. *************************************************************************/
  25.  
  26.  
  27.  
  28. #ifndef MAXLINES
  29. #define MAXLINES 1               /* the number of lines in the system */
  30.                     /* a SYSTEM wide global!! */
  31. #endif /* MAXLINES */
  32.  
  33. #define FILL    16               /* link table area for packet/frame */
  34. #define FILLM    26               /* link table area for monitor/switch */
  35.  
  36.  
  37. /*    These two structs make up the inviolate region of the table */
  38. struct mon_struc {               /* these pertain to monitor
  39.                           initialization */
  40.     UWORD buff_offset;               /* offset into the fill area for pool
  41.                           buffer info */
  42.     UWORD prior_offset;               /* order of priority of processes */
  43.     UBYTE num_pools;               /* number of pools to generate */
  44.     UBYTE num_eventcells;           /* number of event cells to gernerat */
  45.     UBYTE shrt_tmouts;               /* number of short timeouts */
  46.     UBYTE lng_tmouts;               /* number of long timeouts */
  47.     UBYTE prior_len;               /* length of priority table */
  48.     UBYTE u_mn1_def;               /* user defined variables */
  49.     UBYTE u_mn2_def;               /* user defined variables */
  50.     UBYTE u_mn3_def;               /* user defined variables */
  51. };
  52.  
  53. struct swit_struc {               /* this contains switch&adaptor values */
  54.  
  55.     UBYTE glun;                   /*  level 3(packet) server lun number */
  56.     UBYTE g2lun;               /*  level 2 (frame) server lun number */
  57.     UBYTE lo_vc;               /*  Lowest lun for virtual circuits */
  58.     UBYTE totl_lun;               /*  total num of luns/virtual circuts */
  59.     UBYTE incall_num;               /*  num of incomming calls */
  60.     UBYTE adapt_df;               /*  default adapter number */
  61.     UBYTE lin_df;               /* default line number to use */
  62.     UBYTE max_adapt;               /*  max number of adapters */
  63.     UBYTE hdr_buf;               /*  YES to allow open if server closed */
  64.     UBYTE hdr_data;               /*  size in front of packets */
  65.     UBYTE tmout_buf;               /*  time out, buff allocation */
  66.     UBYTE eol_adapt;               /*  end of line char for adaptor */
  67.     UBYTE eoh_adapt;               /*  end of host char for adaptor */
  68.     UBYTE eon_adapt;               /*  end of net char for adaptor */
  69.     UBYTE crmod;               /* x29 carriage return mode*/
  70.     UBYTE xraw;                   /* x29 raw io */
  71.     UBYTE nb_flag;               /* number of x29 flags */
  72.     UBYTE io_parm_len;               /* x29 length of the io param table */
  73.     UBYTE io_parm;               /* x29 offset to the io param table */
  74.     UBYTE io_getc_len;               /* x29 length of the getc table */
  75.     UBYTE io_getc;               /* x29 offset to the getc table */
  76.     UBYTE term_off;               /* offset to terminal characteristics */
  77.     UBYTE maxid_sz;
  78.     UBYTE u_1swit;
  79.     UWORD max_sna;
  80.     UBYTE num_uucp;            /* number of lun used for uucp */
  81.     UBYTE offset_uucp;            /* offset to fill area    */
  82.     UBYTE u_2swit;            /* user definable parameter */
  83.     UBYTE u_3swit;            /* user definable parameter */
  84. };
  85.  
  86.  
  87. #ifdef LMS
  88. struct lms_g_struc {
  89. /*
  90. **  Inviolate part of LMS intialization table
  91. */
  92.  
  93.     UWORD    max_hex;        /* Maximum data to display */
  94.     UBYTE    type_lms;        /* Host or port */
  95.     UBYTE    lms_validation;        /* LMS used or not (g_lms_used) */
  96.     UBYTE    lms_fvd ;        /* Default frame validation */
  97.     UBYTE    lms_pvd ;        /* Default packet validation */
  98.     UWORD    lms_fmd ;        /* Default frame mask */
  99.     UWORD    lms_pmd ;        /* Default packet mask */
  100.     UBYTE    trans_spd;        /* async transmission speed */
  101.     UBYTE    parity;            /* async parity */
  102.     UBYTE    wrd_size;        /* async word size */
  103.         UBYTE    u_lms1;            /* user defined variables */
  104.         UBYTE    u_lms2;            /* user defined variables */
  105.         UBYTE    u_lms3;            /* user defined variables */
  106. };
  107. #endif /* LMS */
  108.  
  109. struct fram_struc {               /* frame initialization (downloadable) 
  110.                        */
  111.     UWORD window;               /* window size of the frame */
  112.     UBYTE max_recvbuf;               /* max number of receive bufs */
  113.     UBYTE min_recvbuf;               /* min number of receive bufs */
  114.     UBYTE trans_spd;               /* transmission speed on the line */
  115.     UBYTE t1_tmout;               /* t1 time out value */
  116.     UBYTE t4_tmout ;               /* t4 time out value (ISO) */
  117.  
  118.     UBYTE n2_rep;               /* n2 repatition rate */
  119.     UBYTE connect_md;               /* connection mode */
  120.     UBYTE dcd_p_tm ;               /* DCD polling timer */
  121.     UBYTE dcd_p_nb ;               /* retry counter of DCD polling */
  122.     UBYTE acu_mode ;               /* ACU operation mode */
  123.     UBYTE acu_timer ;               /* the ACU operation timer */
  124.  
  125.     UBYTE term_md;               /* terminal mode */
  126.     UBYTE t3_tmout;               /* SABM repeat rate after n2 */
  127.     UBYTE clk_md;               /* internal or external clock */
  128.     UBYTE lap_md;               /* LAP or LAPB */
  129.     UBYTE modulo_f;               /* frame level modulo number */
  130.     UBYTE xid_p1;               /* xid p1 time out */
  131.     UBYTE xid_c2;               /* xid c2 rep rate */
  132.     UBYTE min_freebuf;               /* RNR minimum number of free buffers */
  133.     UBYTE to_busy;               /* RNR short of buffers, busy timeout value */
  134.     UBYTE u_frm1_def;               /* user definable frame parameter */
  135.     UBYTE u_frm2_def;               /* user definable frame parameter */
  136.     UBYTE u_frm3_def;               /* user definable frame parameter */
  137. };
  138.  
  139.  
  140.  
  141. struct pak_struc {               /* packet initialization (downloadable) */
  142.     UWORD line_type;               /* type of line */
  143.     UWORD pak_siz;               /* max size of packet to receive */
  144.     UWORD hi_chan;               /* highest channel number + 1     */
  145.     UWORD lo_pvc_chan;               /* lowest pvc channel number */
  146.     UWORD num_pvc;               /* number of pvc's */
  147.     UWORD lo_insvc;               /* lowest incomming svc channel */
  148.     UWORD in_num_svc;               /* number of incomming svc's */
  149.     UWORD lo_svc2;               /* lowest 2 way svc channel */
  150.     UWORD num_svc2;               /* number of 2 way svc's */
  151.     UWORD lo_outsvc;               /* lowest outgoing svc channel */
  152.     UWORD out_num_svc;               /* number of outgoing svc's */
  153.     UWORD rx_pkt_size;               /* default length of input data pak
  154.                           (SVC) */
  155.     UWORD tx_pkt_size;               /* default length of output data (SVC) 
  156.                        */
  157.     UWORD rx_n_pkt;               /* max input length of data packet (SVC)
  158.                           */
  159.     UWORD tx_n_pkt;               /* max output lenght of data packet
  160.                           (SVC) */
  161.     UWORD rx_win_size;               /* default len of in window (SVC) */
  162.     UWORD tx_win_size;               /* default len of out window (SVC) */
  163.     UWORD rx_n_win;               /* max in window size (SVC) */
  164.     UWORD tx_n_win;               /* max out window size (SVC) */
  165.     UWORD pdn_code;               /* code for public data network (0x3110
  166.                           for telenet) */
  167.     UWORD t20_tmout;               /* duration of t20 timer */
  168.     UWORD t21_tmout;               /* duration of t21 timer */
  169.     UWORD t22_tmout;               /* duration of t22 timer */
  170.     UWORD t23_tmout;               /* duration of t23 timer */
  171.     UWORD t28_tmout;                   /* duration of t28 timer */
  172.     UWORD t24_tmout;               /* duration of t24 timer */
  173.     UWORD t25_tmout;               /* duration of t25 timer */
  174.     UWORD t26_tmout;               /* duration of t26 timer */
  175.     UWORD pvc_offset;               /* flow control for  pvc use (PVC) */
  176.     UBYTE net_type;               /* network type */
  177.     UBYTE modulo;               /* mod 8 = 0, mod 128=1 */
  178.     UBYTE glun_process;               /* process num for glun */
  179.     UBYTE negociation;               /* throughput et flow ctrl nego */
  180.     UBYTE call_forbid;               /* forbid incoming calls */
  181.     UBYTE out_call_bar;                /* forbid outgoing calls */
  182.     UBYTE fast_select;               /* authorize fast select */
  183.     UBYTE flow_ctrl;               /* authorize flow control */
  184.     UBYTE d_bit;               /* authorize d bit usage (SVC) */
  185.     UBYTE max_reset;               /* max number of reset packets */
  186.     UBYTE max_clear;               /* max number of clear packets */
  187.     UBYTE max_regist;                  /* max number of registration packet */
  188.     UBYTE rx_def_thru;               /* rx def throughput */
  189.     UBYTE tx_def_thru;               /* tx def throughput */
  190.     UBYTE rx_max_thru;               /* rx max throughput for negotiation */
  191.     UBYTE tx_max_thru;               /* tx throughput for negotiation */
  192.     UBYTE sndrest;               /* indicates restart sent on line up */
  193.     UBYTE u_pak1_def;               /* user definable packet parameters */
  194.     UBYTE u_pak2_def;               /* user definable packet parameters */
  195.     UBYTE u_pak3_def;               /* user definable packet parameters */
  196.     UBYTE u_pak4_def;               /* user definable packet parameters */
  197.     UBYTE cug;                /* closed user group selection */
  198.     UBYTE bcug;                /* Bilateral cug selection */
  199.     UBYTE rev_charging;            /* reverse charging acceptance */
  200.     UBYTE datapac ;
  201.     UBYTE registration ;        /* on line registration facility */
  202.     UBYTE local_charg_prev ;        /* local charging prevention */
  203. };
  204.  
  205.  
  206. /*
  207. **    this structure is overlayed on the fill area for pvc use
  208. **    (the pvc subtable referenced by packet (pak_struc.pvc_offset).
  209. */
  210.  
  211. struct pvc_struc {
  212.     UWORD process;               /* process number for the pvc */
  213.     UWORD lun;                   /* lun number that is a pvc */
  214.     UWORD rec_max;               /* maximum receive packet length */
  215.     UWORD send_max;               /* maximum send packet length */
  216.     UWORD rec_win;               /* maximum window size for receiving */
  217.     UWORD send_win;               /* maximum window size for sending */
  218.     UWORD d_bit;               /* d bit authorized for this pvc (1|0) */
  219.     UWORD flow_cntrl;               /* flow control authorized for this pvc
  220.                           (1|0) */
  221. };
  222.  
  223.  
  224. /*
  225. **    this structure is overlayed on the monitor fill area for pool buffer
  226. **    use.  The index into the fill area is equal to the pool number being
  227. **    initialized.
  228. */
  229.  
  230. struct pool_buf {
  231.     UWORD size_buf;               /* size of each buffer in the pool */
  232.     UWORD buf_num;               /* number of buffers to allocat for that
  233.                           pool */
  234. };
  235.  
  236.  
  237.  
  238. /*
  239. **    the two structures templates declared here are used by initab.c
  240. **    and all the init processes.  They define the two segments of the
  241. **    initialization area, the monitor/switch section, (inviolate) and the 
  242. **    packet/frame/lms area (dynamic).
  243. */
  244.  
  245. struct monswt {
  246.     struct mon_struc    mon_tabl;      /* monitor info */
  247.     struct swit_struc   swit_tabl;     /* switch info */
  248. #ifdef LMS
  249.     struct lms_g_struc  lms_g_tabl;    /* lms global info */
  250. #endif    /* LMS */
  251.     UWORD         mlnk_tabl[FILLM];/* link area */
  252. };
  253.  
  254.  
  255. struct ini_struct {
  256.     struct fram_struc   frm_tabl;      /* frame info */
  257.     struct pak_struc    pak_tabl;      /* packet info */
  258.     UWORD         lnk_tabl[FILL];/* link area */
  259. };
  260.  
  261.  
  262. /*
  263. **    These define SOME of the network types
  264. **    They basically relate to the manner in which REJ packets are
  265. **    replied to.  In the USA, (Telenet to a large part), a SABM
  266. **    is sent.  In Europe (TRANSPAC) an FRMR and then a SABM is sent.
  267. */
  268.  
  269. /************************************************************************
  270. **  #define     TYPE_TRANSPAC    0x01
  271. **  #define     TYPE_X25        0x02
  272. **  #define        TYPE_TELENET    0x83
  273. **  #define        TYPE_DDN        0x84
  274. **  #define        TYPE_PSS        0x05
  275. **  #define        USA_MSK            0x80
  276. ************************************************************************/
  277.